package com.yanqu.road.server.cmd.activity.busyfarming;

import com.yanqu.road.logic.pb.PlayerBasePb;
import com.yanqu.road.pb.activity.BusyFarmingProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.busyfarming.BusyFarmingModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_BUSY_FARMING_WATERING_BACK_FROM_CROSS,desc = "浇水")
public class BusyFarmingWateringBackCmdFromCross extends AbstractCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {

        BusyFarmingProto.BusyFarmingWateringCrossRespMsg respMsg = BusyFarmingProto.BusyFarmingWateringCrossRespMsg.parseFrom(packet.getBytes());


        player.getModule(BusyFarmingModule.class).wateringBack(respMsg.getActivityId(), respMsg.getLand(), respMsg.getSrcUserId(),
                PlayerBasePb.parseToUserBaseInfo(respMsg.getUserBaseInfo()));

    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
